package org.fan;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * 
 * @author Administrator
 *
 */
public class PropertiesVO {
	//文件目录 (未使用)
	String filePath;
	//获取数据 源的EXCEL文件名（包含路径）
	String excelFileName;
	//保存模板的txt文件名 （包含路径）
	String txtTemplateFileName;
	//模板字符串
	String txtTemplateStr;
	
	String toTxtFileStartName;
	
	//读取工作表配置，需要作为输入参数，可以考虑从args中获取
	int sheetflag = 2;
	
	public PropertiesVO initDefault(){
		this.txtTemplateStr =  "Business_UnitCode=110010010, Main_FamilyAdd=广东深圳市福田八卦平安大厦A-810室, Main_FamilyStatus=4, OtherThings=, Main_Department=集中作业部, Loan_BusinessSum=150000, Inside_AssessorCode=XIEBING004, Linkman_NoFamilyMobileTelephone=13572386548, Main_WorkZip=, Loan_Purpose=14, Inside_IntroducerName=, Main_EduExperience=4, Main_SelfMonthIncome=7000, Main_FamilyZIP=, Main_FullName=平安测试20, Linkman_FamilyMobileTelephone=13244557856, Loan_TermMonth=3, Main_Birthday=19901010, Account_PaymentCardID=6555580070225820, Business_ChannelCode=01, Main_CommAdd=, Main_Staff=数据审核岗, Linkman_NoFamilyTelephone=0755-24786533, Inside_Sharp=01, Loan_Pinganh=2, Account_PaymentName=, Linkman_NoFamilyRelationship=2, Business_IntroducerCode=, Main_EmailAdd=CESHI@163.COM, Inside_Case=, Main_Sex=1, Main_Door=2, Main_WorkCorp=, Main_FamilyTel=86-0755-25403130, Main_UnitType=4, Inside_Matter=1, Account_PaymentBank=, Main_WorkBeginDate=0, Loan_Preference=, Main_MobileTelephone=15932188888, Linkman_FamilyName=张华, Main_Isnativehouse=2, Main_WorkTel=86-0755-25830706-600, Main_CertID=330483199010100815, Main_HeadShip=4, Inside_OccupationCode=210, Account_GatheringBank=平安银行, Linkman_NoFamilyName=李四, Main_EngageType=2, Business_CustomerManagerCode=110000007, Inside_Breed=新一贷1140100, Inside_OtherDatum=01/02/10毕业证, Main_QualificationType=, Main_UnitKindCode=119, Loan_Idea=, Inside_IntroducerMobileTelephone=, Inside_CaseElse=, Linkman_FamilyTelephone=0755-23584342, Inside_Unit=, Loan_Fund=1, Account_GatheringCardID=6555580070225820, Account_GatheringName=平安测试20, Main_Marriage=1, Main_Trade=, Inside_SaleMode=, Main_WorkAdd=广东深圳市福田八卦三路, Linkman_FamilyRelationship=1, Loan_payment=0";
		this.excelFileName =  "." + File.separatorChar + "template" + File.separatorChar + "DES录入必要字段.xls";
		this.filePath = "." + File.separatorChar + "";
		this.txtTemplateFileName = "." + File.separatorChar + "template" + File.separatorChar + "template.txt";
		this.sheetflag = this.getSheetFlagByInput();
		this.toTxtFileStartName =  this.getTxtFileName();
		return this;
	}

	public String getTxtFileName(){
		Date  date = new Date(); 
		SimpleDateFormat df  = new SimpleDateFormat( "yyyyMMdd"); 
		if (this.sheetflag == 0){
			return  "." + File.separatorChar + "result" + File.separatorChar + "" +df.format(date)+"-DES"+"03-";
		}else{
			return  "." + File.separatorChar + "result" + File.separatorChar + "" + df.format(date)+"-DES"+"04-" ;
		} 
	}
	
	public int getSheetFlagByInput(){
		int rs=0;
		Scanner scanner = new Scanner(System.in);
		do{
			if(rs!=0&&rs!=1){
				System.out.println("没有这个模板"+rs+"请重新输入。。。");
			} 
			System.out.println("请输入获取第几个工作簿数据：0或者1");
			System.out.println("0代表KB003模板，1代表KB004模板。");
			//System.out.println("请输入获取数据的工作簿，DES03请输入0，DES04请输入1");
			rs =  scanner.nextInt();
			System.out.println("输入的值为:"+rs+"，将获取DES0"+(rs+3)+"中的数据");
		}while(rs!=0&&rs!=1);
		return rs;
		
	}
	
	public String getFilePath() {
		return filePath;
	}


	public int getSheetflag() {
		return sheetflag;
	}

	public void setSheetflag(int sheetflag) {
		this.sheetflag = sheetflag;
	}

	public String getToTxtFileStartName() {
		return toTxtFileStartName;
	}

	public void setToTxtFileStartName(String toTxtFileStartName) {
		this.toTxtFileStartName = toTxtFileStartName;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getExcelFileName() {
		return excelFileName;
	}

	public void setExcelFileName(String excelFileName) {
		this.excelFileName = excelFileName;
	}

	public String getTxtTemplateFileName() {
		return txtTemplateFileName;
	}

	public void setTxtTemplateFileName(String txtTemplateFileName) {
		this.txtTemplateFileName = txtTemplateFileName;
	}

	public String getTxtTemplateStr() {
		return txtTemplateStr;
	}

	public void setTxtTemplateStr(String txtTemplateStr) {
		this.txtTemplateStr = txtTemplateStr;
	}
	
    	
	
}
